package com.ksd.web.controller.system;


import com.ksd.common.core.controller.BaseController;
import com.ksd.common.core.domain.AjaxResult;
import com.ksd.common.utils.DateUtils;
import com.ksd.system.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

/**
 * @Author y.wu
 * @Create 2023/11/9 下午 3:27
 */
@RestController
@RequestMapping("/system/firstIndex")
public class FirstIndexController extends BaseController
{

    @GetMapping("/getIndexInfo")
    public AjaxResult getIndexInfo()
    {
        return success();
    }





    public static void main(String[] args) {

        ArrayList<String> xData = new ArrayList<>();
        Calendar calendar = Calendar.getInstance();
        int k = 6;
        for (int i = 0; i <= k; i++) {
            int j = i - k;
            calendar.setTime(new Date());
            calendar.add(Calendar.DAY_OF_YEAR, j);
            Date nextDay = calendar.getTime();
            String s = DateUtils.dateTime(nextDay);
            System.out.println("s: "+s);
            xData.add(s);
        }

    }

    public ArrayList<String> getXData(int timeframe){
        ArrayList<String> xData = new ArrayList<>();
        Calendar calendar = Calendar.getInstance();
        int k = timeframe - 1;
        for (int i = 0; i <= k; i++) {
            int j = i - k;
            calendar.setTime(new Date());
            calendar.add(Calendar.DAY_OF_YEAR, j);
            Date nextDay = calendar.getTime();
            String s = DateUtils.dateTime(nextDay);
            xData.add(s);
        }
        return xData;
    }

}

